<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.systop.ltbook.webapp.LtConstants, java.util.Map, java.util.List, com.systop.cms.model.Articles, com.systop.cms.model.Catalogs" %>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>中国校校通</title>
  <%@include file="/pages/new/resources.jsp" %>
</head>
<body>
<table width="1002" height="40" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td background="${ctx}/images/lt_new/class_t_bg2.gif">
      <table width="1002" height="40" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="111" align="center" style="color: #000;">
            <b>${catalogName}</b>
          </td>
          <td width="890" align="right" style="padding-right:40px; font-weight: bold;">
          <%
          	Map<String, Object> data = (Map<String, Object>)request.getAttribute("data");
          	List<Catalogs> subs = (List)data.get(LtConstants.SUB_CATALOGS);
          	if (subs != null){
          	for(Catalogs cata :subs){
          %>
            &nbsp;&nbsp;<a href="indexJxqc.do?catalogId=<%=cata.getId()%>" style="color: green;" title="<%=cata.getName() %>"><%=cata.getName() %></a>&nbsp;&nbsp;
          <% }}%>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table width="994" height="470" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="774" height="460" valign="top">
      <table width="774" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="774"  height="300" colspan="3">
            <div style="width:770px;">
            <%
				List<Articles> imgArticles = (List)data.get(LtConstants.IMG_ARTICLES);
            %>
            <% 
              if (imgArticles != null){
                for(Articles art : imgArticles){ %>
                  <div class="books">
		            <div class="bkphoto">
		              <a href="${ctx}/ltart/view.do?model.id=<%=art.getId()%>" target="_blank" title="<%=art.getShortTitle()%>">
		              <img height="100" width="90" src="${ctx}<%=art.getFlashImg()%>" onError="this.src='${ctx}/images/longtian/book_nophoto_big.gif'"></a>
		           </div>
		           <div class="bookinfo">
		             <a href="${ctx}/ltart/view.do?model.id=<%=art.getId()%>" target="_blank" title="<%=art.getShortTitle()%>"><%=art.getShortTitle()%></a>
		           </div>
		         </div>
            <% }} %>
            </div>
          </td>
        </tr>
        <tr>
          <td width="224" height="160" align="center">
            <img src="${ctx}/images/gg/jxqc-left.jpg" width="190">
          </td>
          <%
          	List<Articles> artList = (List)data.get(LtConstants.ARTICLES);
	      	int fstEnd = 0;
	      	int senEnd = 0;
	      	if (artList!= null){
		        int size = artList.size();
		      	if (size > 6){
		      		fstEnd = 6;
		      		senEnd = size;
		      	}else{
		      		fstEnd = size;
		      		senEnd = 0;
		      	}
	      	}
          %>
          
          <td width="275" style="padding-left: 5px;">
	          <% for(int i = 0; i < fstEnd; i++){ %>
		        <div class="bookTitle" title="<%=artList.get(i).getShortTitle()%>">
		        <a href="${ctx}/ltart/view.do?model.id=<%=artList.get(i).getId()%>" target="_blank"><%=artList.get(i).getShortTitle()%></a></div>
	          <% } %>
          </td>
          <td width="275" style="padding-left: 5px;">
             <% 
	        	if (senEnd != 0){
	        	for(int i = 6; i < senEnd; i++){ 
	         %>
		       <div class="bookTitle" title="<%=artList.get(i).getShortTitle()%>">
		       <a href="${ctx}/ltart/view.do?model.id=<%=artList.get(i).getId()%>"  target="_blank"><%=artList.get(i).getShortTitle()%></a></div>
	         <% }} %>
          </td>
        </tr>
      </table>
    </td>
    <td width="220" valign="top">
	  <table width="218" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="36"  align="center" background="${ctx}/images/lt_new/right_bg.gif" class="greenfont">
            &nbsp;本周畅销榜&nbsp;
          </td>
        </tr>
        <tr>
          <td height="300" valign="top" background="${ctx}/images/lt_new/right_2.gif">
            <table width="190" height="284" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="270" valign="top">
                 <%
                   List<Articles>onTops = (List)data.get(LtConstants.ONTOP_ARTICLES);
                   if (onTops != null) {
                   int count = 0;
                   for(Articles art : onTops){ 
                	   count ++ ;
                 %>
                      <div class="orderdiv">
			            <div style="float: left; width: 14px; text-align: right; font-weight: bold;"><%=count%>.</div>
			            <div style="float:right;" class="shotBookTitle" title="<%=art.getShortTitle()%>">
			            <a href="${ctx}/ltart/view.do?model.id=<%=art.getId()%>" target="_blank"><%=art.getShortTitle()%></a></div>
                      </div>
	              <% } }%>
                </td>
              </tr>
            </table>
            <div style="text-align: right; padding:5px 15px 0px 0px;">更多...</div>
            <table width="218" height="14" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                 <td width="218" height="14" background="${ctx}/images/lt_new/right_3.gif"></td>
              </tr>
            </table>
            
            <table width="208" height="104" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td align="center">
                  <img src="${ctx}/images/gg/jxqc-right.jpg" width="208" height="104" />
                </td>
              </tr>
            </table>
            
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>